/*
 * @Date: 2021-09-12 19:21:05
 * @Author: Acckno1
 * @LastEditTime: 2021-09-12 19:22:28
 * @Description: 
 */
#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

int n;

int main() {
    cin >> n;
    int sum = 0, now = 0;
    for (int i = 1; i <= n; i ++ ) {
        int target;
        cin >> target;
        if (target > now) sum += (target - now) * 6;
        else sum += (now - target) * 4;
        now = target;
        sum += 5;
    }
    cout << sum << endl;
    return 0;
}